package com.luoxue.controller;


import com.luoxue.service.SqlExecService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

@RestController
@RequestMapping("/sql_exec")
public class SqlExecController {

    @Resource
    private SqlExecService sqlExecService;

    @RequestMapping("/param")
    public Object queryByParam(@RequestParam Map<String, Object> param) {
        return sqlExecService.query(param);
    }


    @RequestMapping("/body")
    public Object queryByBody(@RequestBody Map<String, Object> param) {
        return sqlExecService.query(param);
    }

}
